1. Field of the Invention
This invention relates to the field of two dimensional paths. More particularly, the invention relates to using and accessing path information maintained in multiple formats in an object oriented system.
2. Background Art
When drawing or printing to a display device or printer, an application developer uses a two dimensional path that is filled or stroked with a pen. A path consists of a combination of elements such as lines and curves. Rendering code is designed to handle certain formats of path elements (certain types of lines and curves), but some applications may want to specify their paths in an alternative format. In the prior art, an application that didn't understand a particular path format was unable to process and utilize that path. Thus, for a device or application to utilize a path, the developer was forced to specify the path in a standard form (in the standard form, only one type of curve segment exists, a Bezier curve segment) to the device directly. Consequently, only a limited set of recognizable paths could be used and customizable formats were not permissible. Such a format restriction is not flexible and limits the developer's use of numerous applications. A background of paths and object oriented systems is described below.
Paths
A path is a two dimensional (2D) trajectory on a drawing surface that can be filled or stroked with a pen. For example, the lines and curves that constitute a text character are paths. Each path may be broken down into a series of lines and curves. Referring to FIG. 2, the text character "R" is comprised of a series of lines and curves: line 201-204; curve 201-202; and line 203-205. The combination of the line 201-204, curve 201-202, and line 203-205 constitute a path for the character "R". The path may be in varying formats. A standard path format that is commonly used is a Bezier path. A Bezier path contains a combination of lines and Bezier curves. A Bezier curve is constructed by blending a set of control points to form a composite describing the curve. For example, referring to FIG. 2, points 201, 206, 207, and 202 are control points used in constructing the Bezier curve 201-202. Polynomial functions blend the four control points to result in the actual curve. Consequently, to construct a Bezier curve, a polynomial function accepts multiple control points and forms a composite function that describes the curve.
The method for developing a Bezier curve (and a resulting path) may not be used in all applications. For example, some applications may use a Spline curve or another customizable format. Further, there are formats that can be used to represent a path that don't translate directly into a rendering algorithm such as a format that might be used to edit a path in a drawing program. With such a format, the prior art forces the drawing program to edit the curve segments as Bezier segments and does not permit the drawing program to use its own format (which may use rational coordinates). Using its own format, the individual coordinates could be edited or transformed more rapidly and efficiently than performing the transform on the forced Bezier path.
To transform a path (e.g., rotate, scale, etc.), the prior art requires a specific type of transform and a specific type of path. The transform and an object that operates on the path expects this specific type of path. If there is more than one form, separate calls are made to transform the path from each of the different formats to the standard format (e.g., one call would render or transform one kind of path and another call would render or transform the other type of path). These calls would have to be enumerated in the object and may not be performed when the developer desires it.
The prior art limits developers to the use of a standard Bezier path. Other types of paths including custom paths must be transformed to a Bezier path prior to utilization by a developer. The lack of flexibility and inability to access and use multiple path formats at the developer's option necessitates the need for the present invention.